﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ActivitiesControl.Domain.Services;

namespace ActivitiesControl.GUI.Desktop
{
	internal class ServicesLocator
	{
		private static IActivityServices activityServices;
		private static IResourceServices resourceServices;
		private static IUserServices userServices;
		private static IProjectServices projectServices;
		private static ICustomerServices customerServices;

		internal static IActivityServices ActivityServices
		{
			get 
			{
				if (activityServices == null)
					activityServices = ServicesProvider.GetActivityServices();

				return activityServices;
			}
		}

		internal static IResourceServices ResourceServices
		{
			get
			{
				if (resourceServices == null)
					resourceServices = ServicesProvider.GetResourceServices();

				return resourceServices;
			}
		}

		internal static IUserServices UserServices
		{
			get
			{
				if (userServices == null)
					userServices = ServicesProvider.GetUserServices();

				return userServices;
			}
		}

		internal static IProjectServices ProjectServices
		{
			get
			{
				if (projectServices == null)
					projectServices = ServicesProvider.GetProjectServices();

				return projectServices;
			}
		}

		internal static ICustomerServices CustomerServices
		{
			get
			{
				if (customerServices == null)
					customerServices = ServicesProvider.GetCustomerServices();

				return customerServices;
			}
		}
	
	}
}
